package com.ayoka.parenting.http;

import android.text.TextUtils;

import com.ayoka.parenting.Constants;
import com.ayoka.parenting.bean.ApplyCoachConditionBean;
import com.ayoka.parenting.bean.BaseResponse;
import com.ayoka.parenting.bean.BasicUserInfoBean;
import com.ayoka.parenting.bean.CircleGroupBean;
import com.ayoka.parenting.bean.CircleMemberBean;
import com.ayoka.parenting.bean.ClassroomBean;
import com.ayoka.parenting.bean.ClassroomDetailBean;
import com.ayoka.parenting.bean.CoachInviteCodeBean;
import com.ayoka.parenting.bean.CommentBean;
import com.ayoka.parenting.bean.DiscussGroupTempRoomBean;
import com.ayoka.parenting.bean.GrownIndexBean;
import com.ayoka.parenting.bean.GrownPathBean;
import com.ayoka.parenting.bean.LiveClassroomDetailBean;
import com.ayoka.parenting.bean.MeditationDetailBean;
import com.ayoka.parenting.bean.MeditationHistoryBean;
import com.ayoka.parenting.bean.MeditationIndexDataBean;
import com.ayoka.parenting.bean.MeditationMoreDataBean;
import com.ayoka.parenting.bean.MeditationQuestionBean;
import com.ayoka.parenting.bean.MyProfitBean;
import com.ayoka.parenting.bean.NVCBean;
import com.ayoka.parenting.bean.PagerBean;
import com.ayoka.parenting.bean.ProfitRecordBean;
import com.ayoka.parenting.bean.PublishTopicBean;
import com.ayoka.parenting.bean.ResponseMeditationQuestion;
import com.ayoka.parenting.bean.StudentBean;
import com.ayoka.parenting.bean.TodayReportBean;
import com.ayoka.parenting.bean.TopicBean;
import com.ayoka.parenting.bean.UserInfoDetailBean;
import com.ayoka.parenting.bean.UserManager;
import com.ayoka.parenting.mvp.BasePresenter;
import com.ayoka.parenting.ui.live.liveclassroom.LiveClassroomModel;
import com.jincp.common.http.HttpProcessor;
import com.jincp.common.http.HttpRequestParams;

import java.io.File;
import java.util.List;

/**
 * @ProjectName: AyokaClient.
 * @ClassName: API.
 * @Description: .
 * @Author: jincp.
 * @CreateDate: 2019/10/22 16:13.
 */

public class API {


    /**
     * 获取用户信息
     *
     * @param presenter
     * @param code
     * @param callback
     */
    public static void doLoginByWX(BasePresenter presenter, String code, HttpBeanInterceptCallback<BaseResponse<UserManager>> callback) {
        String url = Constants.getBaseApiUrl() + "User/AppLogin";
        HttpRequestParams params = new HttpRequestParams();
        params.put("errcode", code);
        HttpProcessor.getInstance().get(presenter, url, false, params, callback);
    }

    /**
     * 刷新token
     *
     * @param userID
     * @param refresh_token
     * @param callback
     */
    public static void refreshToken(BasePresenter presenter, String userID, String refresh_token, HttpBeanInterceptCallback<BaseResponse<UserManager.TokenBean>> callback) {
        String url = Constants.getBaseApiUrl() + "User/RefreshToken";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("uid", userID);
        params.putJson("refresh_token", refresh_token);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 发送验证码
     *
     * @param token
     * @param mobile
     * @param callback
     */
    public static void sendVerifyCode(BasePresenter presenter, String token, String mobile, HttpBeanInterceptCallback<BaseResponse<NVCBean>> callback) {
        String url = Constants.getBaseApiUrl() + "User/SendLoginVeriCode";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("token", token);
        params.putJson("cellphone", mobile);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 登录
     *
     * @param presenter
     * @param token
     * @param mobile
     * @param verifyCode
     * @param callback
     */
    public static void LoginWithCellphone(BasePresenter presenter, String token, String mobile, String verifyCode, HttpBeanInterceptCallback<BaseResponse<NVCBean>> callback) {
        String url = Constants.getBaseApiUrl() + "User/LoginWithCellphone";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("token", token);
        params.putJson("cellphone", mobile);
        params.putJson("veriCode", verifyCode);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 获取用户详情
     *
     * @param presenter
     * @param callback
     */
    public static void getUserInformation(BasePresenter presenter, HttpBeanInterceptCallback<BaseResponse<UserInfoDetailBean>> callback) {
        String url = Constants.getBaseApiUrl() + "User/GetUserInfo";
        HttpProcessor.getInstance().get(presenter, url, false, null, callback);
    }

    /**
     * 获取冥想首页数据
     *
     * @param presenter
     * @param callback
     */
    public static void getMeditationIndexData(BasePresenter presenter, HttpBeanInterceptCallback<BaseResponse<MeditationIndexDataBean>> callback) {
        String url = Constants.getBaseApiUrl() + "Meditation/Index";
        HttpProcessor.getInstance().get(presenter, url, false, null, callback);
    }


    /**
     * 获取冥想更多数据
     *
     * @param presenter
     * @param callback
     */
    public static void getMeditationMoreListData(BasePresenter presenter, HttpBeanInterceptCallback<BaseResponse<MeditationMoreDataBean>> callback) {
        String url = Constants.getBaseApiUrl() + "Meditation/List";
        HttpProcessor.getInstance().get(presenter, url, false, null, callback);
    }

    /**
     * 获取冥想详情
     *
     * @param presenter
     * @param meditationId
     * @param callback
     */
    public static void getMeditationDetailData(BasePresenter presenter, String meditationId, HttpBeanInterceptCallback<BaseResponse<MeditationDetailBean>> callback) {
        String url = Constants.getBaseApiUrl() + "Meditation/Detail";
        HttpRequestParams params = new HttpRequestParams();
        params.put("id", meditationId);
        HttpProcessor.getInstance().get(presenter, url, false, params, callback);
    }

    /**
     * 获取我的成长课列表
     *
     * @param presenter
     * @param callback
     */
    public static void getMyClassRoomList(BasePresenter presenter, HttpBeanInterceptCallback<BaseResponse<GrownIndexBean>> callback) {
        String url = Constants.getBaseApiUrl() + "LiveCourse/MyClassRoomList";
        HttpRequestParams params = new HttpRequestParams();
        HttpProcessor.getInstance().get(presenter, url, false, params, callback);
    }

    /**
     * 获取所有成长课列表
     *
     * @param presenter
     * @param classroomType
     * @param callback
     */
    public static void getAllClassRoomListData(BasePresenter presenter, int classroomType, HttpBeanInterceptCallback<BaseResponse<List<ClassroomBean>>> callback) {
        String url = Constants.getBaseApiUrl() + "LiveCourse/GetAllClassRoom";
        HttpRequestParams params = new HttpRequestParams();
        params.put("IsOnTrial", String.valueOf(classroomType));
        HttpProcessor.getInstance().get(presenter, url, false, params, callback);
    }

    /**
     * 报名课程
     *
     * @param presenter
     * @param classroomId
     * @param callback
     */
    public static void joinClassroom(BasePresenter presenter, String classroomId, HttpBeanInterceptCallback<BaseResponse> callback) {
        String url = Constants.getBaseApiUrl() + "LiveCourse/JoinClassRoom";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("classRoomId", classroomId);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 获取即将开始上课或正在上课的课程详情
     *
     * @param presenter
     * @param scheduleId
     * @param callback
     */
    public static void enterLiveRoom(BasePresenter presenter, String scheduleId, HttpBeanInterceptCallback<BaseResponse<LiveClassroomDetailBean>> callback) {
        String url = Constants.getBaseApiUrl() + "LiveCourse/EnterRoom";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("scheduleId", scheduleId);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 教练获取分组讨论临时房间信息
     *
     * @param presenter
     * @param scheduleId
     * @param callback
     */
    public static void GetScheduleTempSubRoom(BasePresenter presenter, String scheduleId, HttpBeanInterceptCallback<BaseResponse<DiscussGroupTempRoomBean>> callback) {
        String url = Constants.getBaseApiUrl() + "LiveCourse/GetScheduleTempSubRoom";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("scheduleId", scheduleId);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 获取用户信息
     *
     * @param liveClassroomModel
     * @param userId
     * @param callback
     */
    public static void getMemberData(LiveClassroomModel liveClassroomModel, String userId, HttpBeanInterceptCallback<BaseResponse<BasicUserInfoBean>> callback) {
        String url = Constants.getBaseApiUrl() + "LiveCourse/GetOnlineMemberInfo";
        HttpRequestParams params = new HttpRequestParams();
        params.put("uid", userId);
        HttpProcessor.getInstance().get(liveClassroomModel, url, false, params, callback);
    }

    /**
     * 获取分组讨论环节的分组讨论房间信息
     *
     * @param presenter
     * @param roomId
     * @param scheduleId
     * @param callback
     */
    public static void getDiscussGroupDetailData(BasePresenter presenter, int roomId, String scheduleId, HttpBeanInterceptCallback<BaseResponse<DiscussGroupTempRoomBean>> callback) {
        String url = Constants.getBaseApiUrl() + "LiveCourse/GetScheduleGroupDiscussionSubRoom";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("scheduleId", scheduleId);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 更新用户当前为正在发言状态
     *
     * @param presenter
     * @param subRoomID
     * @param callback
     */
    public static void updateMemberIsSpeaking(BasePresenter presenter, int subRoomID, String userId, HttpBeanInterceptCallback<BaseResponse> callback) {
        String url = Constants.getBaseApiUrl() + "LiveCourse/UpdateMemberIsSpeaking";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("subRoomId", String.valueOf(subRoomID));
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 更新用户当前为停止发言状态
     *
     * @param presenter
     * @param subRoomID
     * @param callback
     */
    public static void updateMemberUnSpeaking(BasePresenter presenter, int subRoomID, String userId, HttpBeanInterceptCallback<BaseResponse> callback) {
        String url = Constants.getBaseApiUrl() + "LiveCourse/UpdateMemberUnSpeaking";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("subRoomId", String.valueOf(subRoomID));
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 判断当前分房间是否有人正在麦上发言
     *
     * @param presenter
     * @param subRoomID
     * @param callback
     */
    public static void checkHasMemberIsSpeaking(BasePresenter presenter, int subRoomID, HttpBeanInterceptCallback<BaseResponse<Integer>> callback) {
        String url = Constants.getBaseApiUrl() + "LiveCourse/CheckHasMemberIsSpeaking";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("subRoomId", String.valueOf(subRoomID));
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 成长课详情
     *
     * @param presenter
     * @param classroomId
     * @param callback
     */
    public static void getClassroomDetailData(BasePresenter presenter, String classroomId, HttpBeanInterceptCallback<BaseResponse<ClassroomDetailBean>> callback) {
        String url = Constants.getBaseApiUrl() + "LiveCourse/GetClassRoomByID";
        HttpRequestParams params = new HttpRequestParams();
        params.put("id", classroomId);
        HttpProcessor.getInstance().get(presenter, url, false, params, callback);
    }

    /**
     * 成长课分享
     *  @param presenter
     * @param classroomId
     * @param callback
     */
    public static void getGrownClassroomShareData(BasePresenter presenter, String classroomId, HttpBeanInterceptCallback<BaseResponse<ClassroomDetailBean>> callback) {
        String url = Constants.getBaseApiUrl() + "LiveCourse/GetClassRoomPoster";
        HttpRequestParams params = new HttpRequestParams();
        params.put("id", classroomId);
        HttpProcessor.getInstance().get(presenter, url, false, params, callback);
    }

    /**
     * 获取全部圈子列表
     *
     * @param presenter
     * @param pageNo
     * @param pageSize
     * @param callback
     */
    public static void getCircleGroupListData(BasePresenter presenter, int pageNo, int pageSize, HttpBeanInterceptCallback<BaseResponse<PagerBean<CircleGroupBean>>> callback) {
        String url = Constants.getBaseApiUrl() + "Group/GetAllGroups";
        HttpRequestParams params = new HttpRequestParams();
        params.put("page", pageNo);
        params.put("pagesize", pageSize);
        HttpProcessor.getInstance().get(presenter, url, false, params, callback);
    }

    /**
     * 申请加入圈子
     *
     * @param presenter
     * @param groupId
     * @param callback
     */
    public static void joinGroup(BasePresenter presenter, String groupId, HttpBeanInterceptCallback<BaseResponse> callback) {
        String url = Constants.getBaseApiUrl() + "Group/JoinGroup";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("group_id", groupId);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 获取圈子详情
     *
     * @param presenter
     * @param circleGroupId
     * @param callback
     */
    public static void getCircleGroupDetail(BasePresenter presenter, String circleGroupId, HttpBeanInterceptCallback<BaseResponse<CircleGroupBean>> callback) {
        String url = Constants.getBaseApiUrl() + "Group/GetGroupInfo";
        HttpRequestParams params = new HttpRequestParams();
        params.put("id", circleGroupId);
        HttpProcessor.getInstance().get(presenter, url, false, params, callback);
    }

    /**
     * 读取圈子主题列表
     *
     * @param presenter
     * @param circleGroupId
     * @param pageNo
     * @param pageSize
     * @param callback
     */
    public static void getCircleGroupTopicListData(BasePresenter presenter, String circleGroupId, int pageNo, int pageSize, HttpBeanInterceptCallback<BaseResponse<PagerBean<TopicBean>>> callback) {
        String url = Constants.getBaseApiUrl() + "Group/GetTopics";
        HttpRequestParams params = new HttpRequestParams();
        params.put("id", circleGroupId);
        params.put("page", pageNo);
        params.put("pagesize", pageSize);
        HttpProcessor.getInstance().get(presenter, url, false, params, callback);
    }

    /**
     * 申请加入圈子
     *
     * @param presenter
     * @param circleGroupId
     * @param callback
     */
    public static void joinCircle(BasePresenter presenter, String circleGroupId, HttpBeanInterceptCallback<BaseResponse> callback) {
        String url = Constants.getBaseApiUrl() + "Group/JoinGroup";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("group_id", circleGroupId);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 退出圈子
     *
     * @param presenter
     * @param circleGroupId
     * @param callback
     */
    public static void quitCircle(BasePresenter presenter, String circleGroupId, HttpBeanInterceptCallback<BaseResponse> callback) {
        String url = Constants.getBaseApiUrl() + "Group/ExitGroup";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("group_id", circleGroupId);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 点赞话题
     *
     * @param presenter
     * @param topicId
     * @param callback
     */
    public static void praiseTopic(BasePresenter presenter, String topicId, HttpBeanInterceptCallback<BaseResponse> callback) {
        String url = Constants.getBaseApiUrl() + "Group/TopicLike";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("TopicID", topicId);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 点赞话题
     *
     * @param presenter
     * @param topicId
     * @param callback
     */
    public static void cancelPraiseTopic(BasePresenter presenter, String topicId, HttpBeanInterceptCallback<BaseResponse> callback) {
        String url = Constants.getBaseApiUrl() + "Group/CancelTopicLike";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("TopicID", topicId);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 获取评论列表
     *
     * @param presenter
     * @param topicId
     * @param pageNo
     * @param pageSize
     * @param callback
     */
    public static void getTopicCommentListData(BasePresenter presenter, String topicId, int pageNo, int pageSize, HttpBeanInterceptCallback<BaseResponse<PagerBean<CommentBean>>> callback) {
        String url = Constants.getBaseApiUrl() + "Group/GetTopicComments";
        HttpRequestParams params = new HttpRequestParams();
        params.put("id", topicId);
        params.put("page", pageNo);
        params.put("pagesize", pageSize);
        HttpProcessor.getInstance().get(presenter, url, false, params, callback);
    }

    /**
     * 提交评论
     *
     * @param presenter
     * @param replyToUserId
     * @param replyToTopicID
     * @param topicId
     * @param commentContent
     * @param callback
     */
    public static void commentTopic(BasePresenter presenter, String replyToUserId, String replyToTopicID, String topicId, String commentContent, HttpBeanInterceptCallback<BaseResponse<CommentBean>> callback) {
        String url = Constants.getBaseApiUrl() + "Group/PostComment";
        HttpRequestParams params = new HttpRequestParams();
        if (!TextUtils.isEmpty(replyToUserId) && !TextUtils.isEmpty(replyToTopicID)) {
            params.putJson("ReplyToUid", replyToUserId);
            params.putJson("ReplyToTopicID", replyToTopicID);
        }
        params.putJson("TopicID", topicId);
        params.putJson("Content", commentContent);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 评论点赞
     *
     * @param presenter
     * @param commentId
     * @param callback
     */
    public static void praiseComment(BasePresenter presenter, String commentId, HttpBeanInterceptCallback<BaseResponse> callback) {
        String url = Constants.getBaseApiUrl() + "Group/SetCommentLike";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("id", commentId);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 取消评论点赞
     *
     * @param presenter
     * @param commentId
     * @param callback
     */
    public static void cancelPraiseComment(BasePresenter presenter, String commentId, HttpBeanInterceptCallback<BaseResponse> callback) {
        String url = Constants.getBaseApiUrl() + "Group/CancelCommentLike";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("id", commentId);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }


    /**
     * 评论精评
     *
     * @param presenter
     * @param commentId
     * @param callback
     */
    public static void starComment(BasePresenter presenter, String commentId, HttpBeanInterceptCallback<BaseResponse> callback) {
        String url = Constants.getBaseApiUrl() + "Group/SetCommentIsGood";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("id", commentId);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 取消评论精评
     *
     * @param presenter
     * @param commentId
     * @param callback
     */
    public static void cancelStarComment(BasePresenter presenter, String commentId, HttpBeanInterceptCallback<BaseResponse> callback) {
        String url = Constants.getBaseApiUrl() + "Group/CancelCommentIsGood";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("id", commentId);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 发表评论
     *
     * @param presenter
     * @param circleGroupId
     * @param content
     * @param file
     * @param callback
     */
    public static void publishTopic(BasePresenter presenter, String circleGroupId, String content, File file, HttpBeanInterceptCallback<BaseResponse<PublishTopicBean>> callback) {
        String url = Constants.getBaseApiUrl() + "Group/PostTopic";
        HttpRequestParams params = new HttpRequestParams();
        params.put("id", circleGroupId);
        params.put("Content", content);
        if (file != null) {
            params.putFile("File", file);
        }
        HttpProcessor.getInstance().post(presenter, url, true, params, callback);
    }

    /**
     * 删除发表主题
     *
     * @param presenter
     * @param topicId
     * @param callback
     */
    public static void deleteTopic(BasePresenter presenter, String topicId, HttpBeanInterceptCallback<BaseResponse> callback) {
        String url = Constants.getBaseApiUrl() + "Group/DeleteTopic";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("TopicID", topicId);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 置顶Topic
     *
     * @param presenter
     * @param topicId
     * @param callback
     */
    public static void topTopic(BasePresenter presenter, String topicId, HttpBeanInterceptCallback<BaseResponse> callback) {
        String url = Constants.getBaseApiUrl() + "Group/UpTopic";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("TopicID", topicId);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 取消Topic置顶
     *
     * @param presenter
     * @param topicId
     * @param callback
     */
    public static void cancelTopTopic(BasePresenter presenter, String topicId, HttpBeanInterceptCallback<BaseResponse> callback) {
        String url = Constants.getBaseApiUrl() + "Group/CancelUpTopic";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("TopicID", topicId);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 读取圈子每日任务报表
     *
     * @param presenter
     * @param topicId
     * @param date
     * @param callback
     */
    public static void getTodayReportData(BasePresenter presenter, String topicId, String date, HttpBeanInterceptCallback<BaseResponse<TodayReportBean>> callback) {
        String url = Constants.getBaseApiUrl() + "Group/GroupDailyTaskReport";
        HttpRequestParams params = new HttpRequestParams();
        params.put("group_id", topicId);
        params.put("date", date);
        HttpProcessor.getInstance().get(presenter, url, false, params, callback);
    }

    /**
     * 读取圈子成员列表
     *
     * @param presenter
     * @param topicId
     * @param pageNo
     * @param pageSize
     * @param callback
     */
    public static void getCircleGroupMemberListData(BasePresenter presenter, String topicId, int pageNo, int pageSize, HttpBeanInterceptCallback<BaseResponse<PagerBean<CircleMemberBean>>> callback) {
        String url = Constants.getBaseApiUrl() + "Group/GetGroupMembers";
        HttpRequestParams params = new HttpRequestParams();
        params.put("group_id", topicId);
        params.put("page", pageNo);
        params.put("pagesize", pageSize);
        HttpProcessor.getInstance().get(presenter, url, false, params, callback);
    }

    /**
     * 批准成员加入圈子
     *
     * @param presenter
     * @param topicId
     * @param userId
     * @param callback
     */
    public static void agreeApply(BasePresenter presenter, String topicId, String userId, HttpBeanInterceptCallback<BaseResponse> callback) {
        String url = Constants.getBaseApiUrl() + "Group/ApproveJoinin";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("group_id", topicId);
        params.putJson("uid", userId);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 移除圈成员
     *
     * @param presenter
     * @param topicId
     * @param userId
     * @param callback
     */
    public static void deleteMember(BasePresenter presenter, String topicId, String userId, HttpBeanInterceptCallback<BaseResponse> callback) {
        String url = Constants.getBaseApiUrl() + "Group/DelMember";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("group_id", topicId);
        params.putJson("uid", userId);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 获取成长路径
     *
     * @param presenter
     * @param pageNo
     * @param pageSize
     * @param callback
     */
    public static void getGrownPathListData(BasePresenter presenter, int pageNo, int pageSize, HttpBeanInterceptCallback<BaseResponse<PagerBean<GrownPathBean>>> callback) {
        String url = Constants.getBaseApiUrl() + "User/GetMeditationHistory";
        HttpRequestParams params = new HttpRequestParams();
        params.put("page", String.valueOf(pageNo));
        params.put("pagesize", String.valueOf(pageSize));
        HttpProcessor.getInstance().get(presenter, url, false, params, callback);
    }


    /**
     * 获学员列表
     *
     * @param presenter
     * @param pageNo
     * @param pageSize
     * @param callback
     */
    public static void getStudentListData(BasePresenter presenter, int managerType, int pageNo, int pageSize, HttpBeanInterceptCallback<BaseResponse<PagerBean<StudentBean>>> callback) {
        String url = Constants.getBaseApiUrl() + "Coach/GetStudentListByCoachUid";
        HttpRequestParams params = new HttpRequestParams();
        params.put("status", managerType);
        params.put("page", pageNo);
        params.put("pagesize", pageSize);
        HttpProcessor.getInstance().get(presenter, url, false, params, callback);
    }

    /**
     * 获教练分享吗
     *
     * @param presenter
     * @param callback
     */
    public static void getInviteCodeData(BasePresenter presenter, HttpBeanInterceptCallback<BaseResponse<CoachInviteCodeBean>> callback) {
        String url = Constants.getBaseApiUrl() + "Coach/CoachPost";
        HttpProcessor.getInstance().get(presenter, url, false, null, callback);
    }

    /**
     * 获取我的收益
     *
     * @param presenter
     * @param callback
     */
    public static void getMyProfitData(BasePresenter presenter, HttpBeanInterceptCallback<BaseResponse<MyProfitBean>> callback) {
        String url = Constants.getBaseApiUrl() + "Coach/MyIncome";
        HttpProcessor.getInstance().get(presenter, url, false, null, callback);
    }

    /**
     * 收益记录列表
     *
     * @param presenter
     * @param pageNo
     * @param pageSize
     * @param callback
     */
    public static void getProfitRecordListData(BasePresenter presenter, int pageNo, int pageSize, HttpBeanInterceptCallback<BaseResponse<PagerBean<ProfitRecordBean>>> callback) {
        String url = Constants.getBaseApiUrl() + "Coach/GetCommissionRecordList";
        HttpRequestParams params = new HttpRequestParams();
        params.put("page", pageNo);
        params.put("pagesize", pageSize);
        HttpProcessor.getInstance().get(presenter, url, false, params, callback);
    }

    /**
     * 获取学员信息
     *
     * @param presenter
     * @param studentId
     * @param callback
     */
    public static void getStudentData(BasePresenter presenter, String studentId, HttpBeanInterceptCallback<BaseResponse<UserInfoDetailBean>> callback) {
        String url = Constants.getBaseApiUrl() + "Coach/GetStudentInfo";
        HttpRequestParams params = new HttpRequestParams();
        params.put("student_uid", studentId);
        HttpProcessor.getInstance().get(presenter, url, false, params, callback);
    }

    /**
     * 获取学员成长路径列表
     *
     * @param presenter
     * @param studentId
     * @param pageNo
     * @param pageSize
     * @param callback
     */
    public static void getStudentGrowPathListData(BasePresenter presenter, String studentId, int pageNo, int pageSize, HttpBeanInterceptCallback<BaseResponse<PagerBean<GrownPathBean>>> callback) {
        String url = Constants.getBaseApiUrl() + "Coach/GetStudentHistory";
        HttpRequestParams params = new HttpRequestParams();
        params.put("student_uid", studentId);
        params.put("page", pageNo);
        params.put("pagesize", pageSize);
        HttpProcessor.getInstance().get(presenter, url, false, params, callback);
    }

    /**
     * 获取冥想历史记录
     *
     * @param presenter
     * @param recordId
     * @param callback
     */
    public static void getMeditationHistoryData(BasePresenter presenter, String recordId, HttpBeanInterceptCallback<BaseResponse<MeditationHistoryBean>> callback) {
        String url = Constants.getBaseApiUrl() + "Meditation/GetMeditationHistoryInfo";
        HttpRequestParams params = new HttpRequestParams();
        params.put("record_id", recordId);
        HttpProcessor.getInstance().get(presenter, url, false, params, callback);
    }

    /**
     * 添加评论
     *
     * @param presenter
     * @param recordId
     * @param commentContent
     * @param callback
     */
    public static void submitComment(BasePresenter presenter, String recordId, String commentContent, HttpBeanInterceptCallback<BaseResponse> callback) {
        String url = Constants.getBaseApiUrl() + "Meditation/AddMeditationRecordComment";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("HistoryID", recordId);
        params.putJson("Word", commentContent);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 获取申请教练条件
     *
     * @param presenter
     * @param callback
     */
    public static void getMyInvitedUserCount(BasePresenter presenter, HttpBeanInterceptCallback<BaseResponse<ApplyCoachConditionBean>> callback) {
        String url = Constants.getBaseApiUrl() + "User/GetMyInvitedUserCount";
        HttpProcessor.getInstance().get(presenter, url, false, null, callback);
    }

    /**
     * 申请哈巴教练
     *
     * @param presenter
     * @param name
     * @param applyType
     * @param birthDate
     * @param degree
     * @param province
     * @param city
     * @param work
     * @param contractMobile
     * @param email
     * @param contractAddress
     * @param parent
     * @param children
     * @param wechatNumber
     * @param complete
     * @param experience
     * @param extra
     * @param callback
     */
    public static void submitApplyCoach(BasePresenter presenter, String name, int applyType, String birthDate, int degree, String province, String city, String work, String contractMobile, String email, String contractAddress, int parent, int children, String wechatNumber, int complete, String experience, String extra, HttpBeanInterceptCallback<BaseResponse<ApplyCoachConditionBean>> callback) {
        String url = Constants.getBaseApiUrl() + "Coach/AddCoachApplication";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("RealName", name);
        params.putJson("ApplyType", String.valueOf(applyType));
        params.putJson("BirthDay", birthDate);
        params.putJson("Degree", String.valueOf(degree));
        params.putJson("Province", province);
        params.putJson("City", city);
        params.putJson("Career", work);
        params.putJson("Cellphone", contractMobile);
        params.putJson("Email", email);
        params.putJson("Address", contractAddress);
        params.putJson("Sex", String.valueOf(parent));
        params.putJson("Childs", String.valueOf(children));
        params.putJson("Weixin", wechatNumber);
        params.putJson("IsCompletedMeditation", String.valueOf(complete));
        params.putJson("Introduce", experience);
        params.putJson("Other", extra);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 邀请记录
     *
     * @param presenter
     * @param pageNo
     * @param pageSize
     * @param callback
     */
    public static void getInvitedRecordListData(BasePresenter presenter, int pageNo, int pageSize, HttpBeanInterceptCallback<BaseResponse<List<BasicUserInfoBean>>> callback) {
        String url = Constants.getBaseApiUrl() + "User/GetMyInvitedUserList";
        HttpProcessor.getInstance().get(presenter, url, false, null, callback);
    }

    /**
     * 更新完成状态
     *
     * @param presenter
     * @param recordId
     * @param playingDuration
     * @param callback
     */
    public static void updateCompletedStatus(BasePresenter presenter, String recordId, int playingDuration, HttpBeanInterceptCallback<BaseResponse> callback) {
        String url = Constants.getBaseApiUrl() + "Meditation/UpdateCompletedStatus";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("record_id", recordId);
        params.putJson("playing_duration", String.valueOf(playingDuration));
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 获取冥想后的问题
     *
     * @param presenter
     * @param recordId
     * @param callback
     */
    public static void getMeditationQuestionPresenter(BasePresenter presenter, String recordId, HttpBeanInterceptCallback<BaseResponse<ResponseMeditationQuestion>> callback) {
        String url = Constants.getBaseApiUrl() + "Meditation/GetMeditationQuestions";
        HttpRequestParams params = new HttpRequestParams();
        params.put("record_id", recordId);
        HttpProcessor.getInstance().get(presenter, url, false, params, callback);
    }

    /**
     * 提交冥想后的问题
     *
     * @param presenter
     * @param recordId
     * @param answerResult
     * @param callback
     */
    public static void saveQuestionAnswer(BasePresenter presenter, String recordId, List<MeditationQuestionBean.AnswerResultBean> answerResult, HttpBeanInterceptCallback<BaseResponse> callback) {
        String url = Constants.getBaseApiUrl() + "Meditation/SaveQuestionAnswer";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("RecordID", recordId);
        params.putJson("AnswerResult", answerResult);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

    /**
     * 同步冥想后的问题到部落
     *
     * @param presenter
     * @param content
     * @param callback
     */
    public static void synchronizedCircleGroup(BasePresenter presenter, String content, HttpBeanInterceptCallback<BaseResponse> callback) {
        String url = Constants.getBaseApiUrl() + "Meditation/BatchPostGroupTopic";
        HttpRequestParams params = new HttpRequestParams();
        params.putJson("content", content);
        HttpProcessor.getInstance().post(presenter, url, false, params, callback);
    }

}
